home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Portable Patmos 1.1 / patmos-src / src / 68040.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-19  |  1.1 KB  |  67 lines  |  [TEXT/MMCC]

  1. #include "crtlocal.h"
  2. #include "proc_mmu.h"
  3.  
  4.      extract(tc, 0x0003);
  5.      extract(itt0, 0x0004);
  6.      extract(itt1, 0x0005);
  7.      extract(dtt0, 0x0006);
  8.      extract(dtt1, 0x0007);
  9.      extract(caar, 0x0802);
  10. //     extract(msp, 0x0803);
  11.      extract(isp, 0x0804);
  12.      extract(mmusr, 0x0805);
  13.      extract(urp, 0x0806);
  14.      extract(srp, 0x0807);
  15.  
  16. #pragma parameter put_dtt0(__D0)
  17.     stuff(put_dtt0, 0x0006);
  18. #pragma parameter put_urp(__D0)
  19.     stuff(put_urp, 0x0806);
  20.     
  21. #pragma parameter __A0 ptestw(__A0)
  22. static long ptestw(long) = {0xF548};
  23.  
  24. static void pflusha(void) = {0xF518};
  25. static void pflushan(void) = {0xF510};
  26. static void cpusha(void) = {0xF4F8};
  27.  
  28. long get_68040_tc()
  29.     {
  30.     return tc();
  31.     }
  32.  
  33. void get_68040_crp(long *vec)
  34.     {
  35.     vec[0] = 127;
  36.     vec[1] = urp();
  37.     }
  38.  
  39. void get_68040_srp(long *vec)
  40.     {
  41.     vec[0] = 127;
  42.     vec[1] = srp();
  43.     }
  44.     
  45. void put_68040_crp(long *vec)
  46.     {
  47.     put_urp(vec[1]);
  48.     }
  49.  
  50. void flush_68040_caches(void)
  51.     {
  52.     cpusha();    
  53.     }
  54.  
  55. void flush_68040_mmu_caches(void)
  56.     {
  57.     pflusha();
  58.     pflushan();
  59.     }
  60.  
  61. #define MMU68040
  62. pascal void trap_patch_68040_0(void)
  63. #include "patch0.c"
  64.  
  65. pascal void trap_patch_68040_1(unsigned short fault)
  66. #include "patch1.c"
  67.